package cn.niit.service.impl;

import cn.niit.dao.UserDao;
import cn.niit.service.UserService;

/**
 * @title: UserServiceProxy
 * @Author Zhj
 * @Date: 2021/10/13 19:21
 * @Version 1.0
 */
public class UserServiceProxy implements UserService {
    /*  添加用户*/
    private UserDao userDao;
    public int addUser(){
        System.out.println("[UserServiceImpl]处理业务逻辑");
        return userDao.insert();
    }

    private  UserServiceImpl userService;
    public void setUserService(UserServiceImpl userService) {
        this.userService = userService;
    }

    public void add(){
        log("add");
        userService.add();
    }
    public void delete(){
        log("delete");
        userService.delete();
    }
    public void update(){
        log("update");
        userService.update();
    }
    public void query(){
        log("query");
        userService.query();
    }
    public void log(String msg){
        System.out.println("执行了"+msg+"方法");
    }
}
